3.806 \(\int \frac {\cos ^2(c+d x) (B \sec (c+d x)+C \sec ^2(c+d x))}{(a+b \sec (c+d x))^2} \, dx\)
Optimal. Leaf size=180 \[ -\frac {x (2 b B-a C)}{a^3}+\frac {\left (a^2 B+a b C-2 b^2 B\right ) \sin (c+d x)}{a^2 d \left (a^2-b^2\right )}+\frac {b (b B-a C) \sin (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}+\frac {2 b \left (-2 a^3 C+3 a^2 b B+a b^2 C-2 b^3 B\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 d (a-b)^{3/2} (a+b)^{3/2}} \]
[Out]
-(2*B*b-C*a)*x/a^3+2*b*(3*B*a^2*b-2*B*b^3-2*C*a^3+C*a*b^2)*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))
/a^3/(a-b)^(3/2)/(a+b)^(3/2)/d+(B*a^2-2*B*b^2+C*a*b)*sin(d*x+c)/a^2/(a^2-b^2)/d+b*(B*b-C*a)*sin(d*x+c)/a/(a^2-
b^2)/d/(a+b*sec(d*x+c))
________________________________________________________________________________________
Rubi [A] time = 0.63, antiderivative size = 180, normalized size of antiderivative = 1.00,
number of steps used = 7, number of rules used = 7, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.175, Rules used =
{4072, 4030, 4104, 3919, 3831, 2659, 208} \[ \frac {\left (a^2 B+a b C-2 b^2 B\right ) \sin (c+d x)}{a^2 d \left (a^2-b^2\right )}+\frac {2 b \left (3 a^2 b B-2 a^3 C+a b^2 C-2 b^3 B\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 d (a-b)^{3/2} (a+b)^{3/2}}+\frac {b (b B-a C) \sin (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}-\frac {x (2 b B-a C)}{a^3} \]
Antiderivative was successfully verified.
[In]
Int[(Cos[c + d*x]^2*(B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + b*Sec[c + d*x])^2,x]
[Out]
-(((2*b*B - a*C)*x)/a^3) + (2*b*(3*a^2*b*B - 2*b^3*B - 2*a^3*C + a*b^2*C)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2
])/Sqrt[a + b]])/(a^3*(a - b)^(3/2)*(a + b)^(3/2)*d) + ((a^2*B - 2*b^2*B + a*b*C)*Sin[c + d*x])/(a^2*(a^2 - b^
2)*d) + (b*(b*B - a*C)*Sin[c + d*x])/(a*(a^2 - b^2)*d*(a + b*Sec[c + d*x]))
Rule 208
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]
Rule 2659
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]
Rule 3831
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
+ f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Rule 3919
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(c*x)/a,
x] - Dist[(b*c - a*d)/a, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0]
Rule 4030
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*
(B_.) + (A_)), x_Symbol] :> Simp[(b*(A*b - a*B)*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n)/
(a*f*(m + 1)*(a^2 - b^2)), x] + Dist[1/(a*(m + 1)*(a^2 - b^2)), Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*
x])^n*Simp[A*(a^2*(m + 1) - b^2*(m + n + 1)) + a*b*B*n - a*(A*b - a*B)*(m + 1)*Csc[e + f*x] + b*(A*b - a*B)*(m
+ n + 2)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b
^2, 0] && LtQ[m, -1] && !(ILtQ[m + 1/2, 0] && ILtQ[n, 0])
Rule 4072
Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(
x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.), x_Symbol] :> Dist[1/b^2, Int[(a + b*Csc[e + f*x])
^(m + 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Rule 4104
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^
(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(A*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m +
1)*(d*Csc[e + f*x])^n)/(a*f*n), x] + Dist[1/(a*d*n), Int[(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^(n + 1)*Simp[
a*B*n - A*b*(m + n + 1) + a*(A + A*n + C*n)*Csc[e + f*x] + A*b*(m + n + 2)*Csc[e + f*x]^2, x], x], x] /; FreeQ
[{a, b, d, e, f, A, B, C, m}, x] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{(a+b \sec (c+d x))^2} \, dx &=\int \frac {\cos (c+d x) (B+C \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx\\ &=\frac {b (b B-a C) \sin (c+d x)}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))}-\frac {\int \frac {\cos (c+d x) \left (-a^2 B+2 b^2 B-a b C+a (b B-a C) \sec (c+d x)-b (b B-a C) \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{a \left (a^2-b^2\right )}\\ &=\frac {\left (a^2 B-2 b^2 B+a b C\right ) \sin (c+d x)}{a^2 \left (a^2-b^2\right ) d}+\frac {b (b B-a C) \sin (c+d x)}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\int \frac {-\left (a^2-b^2\right ) (2 b B-a C)+a b (b B-a C) \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a^2 \left (a^2-b^2\right )}\\ &=-\frac {(2 b B-a C) x}{a^3}+\frac {\left (a^2 B-2 b^2 B+a b C\right ) \sin (c+d x)}{a^2 \left (a^2-b^2\right ) d}+\frac {b (b B-a C) \sin (c+d x)}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\left (b \left (3 a^2 b B-2 b^3 B-2 a^3 C+a b^2 C\right )\right ) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a^3 \left (a^2-b^2\right )}\\ &=-\frac {(2 b B-a C) x}{a^3}+\frac {\left (a^2 B-2 b^2 B+a b C\right ) \sin (c+d x)}{a^2 \left (a^2-b^2\right ) d}+\frac {b (b B-a C) \sin (c+d x)}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\left (3 a^2 b B-2 b^3 B-2 a^3 C+a b^2 C\right ) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{a^3 \left (a^2-b^2\right )}\\ &=-\frac {(2 b B-a C) x}{a^3}+\frac {\left (a^2 B-2 b^2 B+a b C\right ) \sin (c+d x)}{a^2 \left (a^2-b^2\right ) d}+\frac {b (b B-a C) \sin (c+d x)}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\left (2 \left (3 a^2 b B-2 b^3 B-2 a^3 C+a b^2 C\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^3 \left (a^2-b^2\right ) d}\\ &=-\frac {(2 b B-a C) x}{a^3}+\frac {2 b \left (3 a^2 b B-2 b^3 B-2 a^3 C+a b^2 C\right ) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^3 (a-b)^{3/2} (a+b)^{3/2} d}+\frac {\left (a^2 B-2 b^2 B+a b C\right ) \sin (c+d x)}{a^2 \left (a^2-b^2\right ) d}+\frac {b (b B-a C) \sin (c+d x)}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.09, size = 147, normalized size = 0.82 \[ \frac {\frac {2 b \left (2 a^3 C-3 a^2 b B-a b^2 C+2 b^3 B\right ) \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac {a b^2 (a C-b B) \sin (c+d x)}{(a-b) (a+b) (a \cos (c+d x)+b)}+(c+d x) (a C-2 b B)+a B \sin (c+d x)}{a^3 d} \]
Antiderivative was successfully verified.
[In]
Integrate[(Cos[c + d*x]^2*(B*Sec[c + d*x] + C*Sec[c + d*x]^2))/(a + b*Sec[c + d*x])^2,x]
[Out]
((-2*b*B + a*C)*(c + d*x) + (2*b*(-3*a^2*b*B + 2*b^3*B + 2*a^3*C - a*b^2*C)*ArcTanh[((-a + b)*Tan[(c + d*x)/2]
)/Sqrt[a^2 - b^2]])/(a^2 - b^2)^(3/2) + a*B*Sin[c + d*x] + (a*b^2*(-(b*B) + a*C)*Sin[c + d*x])/((a - b)*(a + b
)*(b + a*Cos[c + d*x])))/(a^3*d)
________________________________________________________________________________________
fricas [B] time = 0.81, size = 788, normalized size = 4.38 \[ \left [\frac {2 \, {\left (C a^{6} - 2 \, B a^{5} b - 2 \, C a^{4} b^{2} + 4 \, B a^{3} b^{3} + C a^{2} b^{4} - 2 \, B a b^{5}\right )} d x \cos \left (d x + c\right ) + 2 \, {\left (C a^{5} b - 2 \, B a^{4} b^{2} - 2 \, C a^{3} b^{3} + 4 \, B a^{2} b^{4} + C a b^{5} - 2 \, B b^{6}\right )} d x + {\left (2 \, C a^{3} b^{2} - 3 \, B a^{2} b^{3} - C a b^{4} + 2 \, B b^{5} + {\left (2 \, C a^{4} b - 3 \, B a^{3} b^{2} - C a^{2} b^{3} + 2 \, B a b^{4}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) + 2 \, {\left (B a^{5} b + C a^{4} b^{2} - 3 \, B a^{3} b^{3} - C a^{2} b^{4} + 2 \, B a b^{5} + {\left (B a^{6} - 2 \, B a^{4} b^{2} + B a^{2} b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{8} - 2 \, a^{6} b^{2} + a^{4} b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{7} b - 2 \, a^{5} b^{3} + a^{3} b^{5}\right )} d\right )}}, \frac {{\left (C a^{6} - 2 \, B a^{5} b - 2 \, C a^{4} b^{2} + 4 \, B a^{3} b^{3} + C a^{2} b^{4} - 2 \, B a b^{5}\right )} d x \cos \left (d x + c\right ) + {\left (C a^{5} b - 2 \, B a^{4} b^{2} - 2 \, C a^{3} b^{3} + 4 \, B a^{2} b^{4} + C a b^{5} - 2 \, B b^{6}\right )} d x - {\left (2 \, C a^{3} b^{2} - 3 \, B a^{2} b^{3} - C a b^{4} + 2 \, B b^{5} + {\left (2 \, C a^{4} b - 3 \, B a^{3} b^{2} - C a^{2} b^{3} + 2 \, B a b^{4}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) + {\left (B a^{5} b + C a^{4} b^{2} - 3 \, B a^{3} b^{3} - C a^{2} b^{4} + 2 \, B a b^{5} + {\left (B a^{6} - 2 \, B a^{4} b^{2} + B a^{2} b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{{\left (a^{8} - 2 \, a^{6} b^{2} + a^{4} b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{7} b - 2 \, a^{5} b^{3} + a^{3} b^{5}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c))^2,x, algorithm="fricas")
[Out]
[1/2*(2*(C*a^6 - 2*B*a^5*b - 2*C*a^4*b^2 + 4*B*a^3*b^3 + C*a^2*b^4 - 2*B*a*b^5)*d*x*cos(d*x + c) + 2*(C*a^5*b
- 2*B*a^4*b^2 - 2*C*a^3*b^3 + 4*B*a^2*b^4 + C*a*b^5 - 2*B*b^6)*d*x + (2*C*a^3*b^2 - 3*B*a^2*b^3 - C*a*b^4 + 2*
B*b^5 + (2*C*a^4*b - 3*B*a^3*b^2 - C*a^2*b^3 + 2*B*a*b^4)*cos(d*x + c))*sqrt(a^2 - b^2)*log((2*a*b*cos(d*x + c
) - (a^2 - 2*b^2)*cos(d*x + c)^2 - 2*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos
(d*x + c)^2 + 2*a*b*cos(d*x + c) + b^2)) + 2*(B*a^5*b + C*a^4*b^2 - 3*B*a^3*b^3 - C*a^2*b^4 + 2*B*a*b^5 + (B*a
^6 - 2*B*a^4*b^2 + B*a^2*b^4)*cos(d*x + c))*sin(d*x + c))/((a^8 - 2*a^6*b^2 + a^4*b^4)*d*cos(d*x + c) + (a^7*b
- 2*a^5*b^3 + a^3*b^5)*d), ((C*a^6 - 2*B*a^5*b - 2*C*a^4*b^2 + 4*B*a^3*b^3 + C*a^2*b^4 - 2*B*a*b^5)*d*x*cos(d
*x + c) + (C*a^5*b - 2*B*a^4*b^2 - 2*C*a^3*b^3 + 4*B*a^2*b^4 + C*a*b^5 - 2*B*b^6)*d*x - (2*C*a^3*b^2 - 3*B*a^2
*b^3 - C*a*b^4 + 2*B*b^5 + (2*C*a^4*b - 3*B*a^3*b^2 - C*a^2*b^3 + 2*B*a*b^4)*cos(d*x + c))*sqrt(-a^2 + b^2)*ar
ctan(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c))) + (B*a^5*b + C*a^4*b^2 - 3*B*a^3*b^3 -
C*a^2*b^4 + 2*B*a*b^5 + (B*a^6 - 2*B*a^4*b^2 + B*a^2*b^4)*cos(d*x + c))*sin(d*x + c))/((a^8 - 2*a^6*b^2 + a^4
*b^4)*d*cos(d*x + c) + (a^7*b - 2*a^5*b^3 + a^3*b^5)*d)]
________________________________________________________________________________________
giac [B] time = 0.49, size = 1107, normalized size = 6.15 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c))^2,x, algorithm="giac")
[Out]
((C*a^8 - 2*B*a^7*b - 3*C*a^7*b + 5*B*a^6*b^2 - 2*C*a^6*b^2 + 4*B*a^5*b^3 + 5*C*a^5*b^3 - 9*B*a^4*b^4 + C*a^4*
b^4 - 2*B*a^3*b^5 - 2*C*a^3*b^5 + 4*B*a^2*b^6 - C*a^3*abs(-a^5 + a^3*b^2) + 2*B*a^2*b*abs(-a^5 + a^3*b^2) - C*
a^2*b*abs(-a^5 + a^3*b^2) + B*a*b^2*abs(-a^5 + a^3*b^2) + C*a*b^2*abs(-a^5 + a^3*b^2) - 2*B*b^3*abs(-a^5 + a^3
*b^2))*(pi*floor(1/2*(d*x + c)/pi + 1/2) + arctan(tan(1/2*d*x + 1/2*c)/sqrt(-(a^4*b - a^2*b^3 + sqrt((a^5 + a^
4*b - a^3*b^2 - a^2*b^3)*(a^5 - a^4*b - a^3*b^2 + a^2*b^3) + (a^4*b - a^2*b^3)^2))/(a^5 - a^4*b - a^3*b^2 + a^
2*b^3))))/(a^4*b*abs(-a^5 + a^3*b^2) - a^2*b^3*abs(-a^5 + a^3*b^2) + (a^5 - a^3*b^2)^2) - ((2*a^2*b + a*b^2 -
2*b^3)*sqrt(-a^2 + b^2)*B*abs(-a^5 + a^3*b^2)*abs(-a + b) - (a^3 + a^2*b - a*b^2)*sqrt(-a^2 + b^2)*C*abs(-a^5
+ a^3*b^2)*abs(-a + b) + (2*a^7*b - 5*a^6*b^2 - 4*a^5*b^3 + 9*a^4*b^4 + 2*a^3*b^5 - 4*a^2*b^6)*sqrt(-a^2 + b^2
)*B*abs(-a + b) - (a^8 - 3*a^7*b - 2*a^6*b^2 + 5*a^5*b^3 + a^4*b^4 - 2*a^3*b^5)*sqrt(-a^2 + b^2)*C*abs(-a + b)
)*(pi*floor(1/2*(d*x + c)/pi + 1/2) + arctan(tan(1/2*d*x + 1/2*c)/sqrt(-(a^4*b - a^2*b^3 - sqrt((a^5 + a^4*b -
a^3*b^2 - a^2*b^3)*(a^5 - a^4*b - a^3*b^2 + a^2*b^3) + (a^4*b - a^2*b^3)^2))/(a^5 - a^4*b - a^3*b^2 + a^2*b^3
))))/((a^5 - a^3*b^2)^2*(a^2 - 2*a*b + b^2) - (a^6*b - 2*a^5*b^2 + 2*a^3*b^4 - a^2*b^5)*abs(-a^5 + a^3*b^2)) +
2*(B*a^3*tan(1/2*d*x + 1/2*c)^3 - B*a^2*b*tan(1/2*d*x + 1/2*c)^3 - B*a*b^2*tan(1/2*d*x + 1/2*c)^3 - C*a*b^2*t
an(1/2*d*x + 1/2*c)^3 + 2*B*b^3*tan(1/2*d*x + 1/2*c)^3 - B*a^3*tan(1/2*d*x + 1/2*c) - B*a^2*b*tan(1/2*d*x + 1/
2*c) + B*a*b^2*tan(1/2*d*x + 1/2*c) - C*a*b^2*tan(1/2*d*x + 1/2*c) + 2*B*b^3*tan(1/2*d*x + 1/2*c))/((a*tan(1/2
*d*x + 1/2*c)^4 - b*tan(1/2*d*x + 1/2*c)^4 - 2*b*tan(1/2*d*x + 1/2*c)^2 - a - b)*(a^4 - a^2*b^2)))/d
________________________________________________________________________________________
maple [B] time = 1.01, size = 453, normalized size = 2.52 \[ \frac {2 b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) B}{d \,a^{2} \left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b -a -b \right )}-\frac {2 b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) C}{d a \left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b -a -b \right )}+\frac {6 b^{2} \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) B}{d a \left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {4 b^{4} \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) B}{d \,a^{3} \left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {4 b \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) C}{d \left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {2 b^{3} \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) C}{d \,a^{2} \left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {2 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,a^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {4 B \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b}{d \,a^{3}}+\frac {2 C \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c))^2,x)
[Out]
2/d/a^2*b^3/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b-a-b)*B-2/d/a*b^2/(a^2-
b^2)*tan(1/2*d*x+1/2*c)/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b-a-b)*C+6/d/a*b^2/(a-b)/(a+b)/((a-b)*(a+
b))^(1/2)*arctanh(tan(1/2*d*x+1/2*c)*(a-b)/((a-b)*(a+b))^(1/2))*B-4/d/a^3*b^4/(a-b)/(a+b)/((a-b)*(a+b))^(1/2)*
arctanh(tan(1/2*d*x+1/2*c)*(a-b)/((a-b)*(a+b))^(1/2))*B-4/d*b/(a-b)/(a+b)/((a-b)*(a+b))^(1/2)*arctanh(tan(1/2*
d*x+1/2*c)*(a-b)/((a-b)*(a+b))^(1/2))*C+2/d/a^2*b^3/(a-b)/(a+b)/((a-b)*(a+b))^(1/2)*arctanh(tan(1/2*d*x+1/2*c)
*(a-b)/((a-b)*(a+b))^(1/2))*C+2/d/a^2*B*tan(1/2*d*x+1/2*c)/(1+tan(1/2*d*x+1/2*c)^2)-4/d/a^3*B*arctan(tan(1/2*d
*x+1/2*c))*b+2/d/a^2*C*arctan(tan(1/2*d*x+1/2*c))
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(cos(d*x+c)^2*(B*sec(d*x+c)+C*sec(d*x+c)^2)/(a+b*sec(d*x+c))^2,x, algorithm="maxima")
[Out]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
for more details)Is 4*a^2-4*b^2 positive or negative?
________________________________________________________________________________________
mupad [B] time = 9.05, size = 3264, normalized size = 18.13 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((cos(c + d*x)^2*(B/cos(c + d*x) + C/cos(c + d*x)^2))/(a + b/cos(c + d*x))^2,x)
[Out]
((2*tan(c/2 + (d*x)/2)^3*(B*a*b^2 - 2*B*b^3 - B*a^3 + B*a^2*b + C*a*b^2))/(a^2*(a + b)*(a - b)) + (2*tan(c/2 +
(d*x)/2)*(B*a^3 - 2*B*b^3 - B*a*b^2 + B*a^2*b + C*a*b^2))/(a^2*(a + b)*(a - b)))/(d*(a + b - tan(c/2 + (d*x)/
2)^4*(a - b) + 2*b*tan(c/2 + (d*x)/2)^2)) + (log(tan(c/2 + (d*x)/2) - 1i)*(2*B*b - C*a)*1i)/(a^3*d) - (log(tan
(c/2 + (d*x)/2) + 1i)*(B*b*2i - C*a*1i))/(a^3*d) - (b*atan(((b*((a + b)^3*(a - b)^3)^(1/2)*((32*tan(c/2 + (d*x
)/2)*(8*B^2*b^8 + C^2*a^8 - 8*B^2*a*b^7 - 2*C^2*a^7*b - 16*B^2*a^2*b^6 + 16*B^2*a^3*b^5 + 5*B^2*a^4*b^4 - 8*B^
2*a^5*b^3 + 4*B^2*a^6*b^2 + 2*C^2*a^2*b^6 - 2*C^2*a^3*b^5 - 5*C^2*a^4*b^4 + 4*C^2*a^5*b^3 + 3*C^2*a^6*b^2 - 8*
B*C*a*b^7 - 4*B*C*a^7*b + 8*B*C*a^2*b^6 + 18*B*C*a^3*b^5 - 16*B*C*a^4*b^4 - 8*B*C*a^5*b^3 + 8*B*C*a^6*b^2))/(a
^6*b + a^7 - a^4*b^3 - a^5*b^2) + (b*((32*(B*a^7*b^5 - 2*B*a^6*b^6 - C*a^12 + 5*B*a^8*b^4 - 3*B*a^9*b^3 - 3*B*
a^10*b^2 + C*a^7*b^5 - 3*C*a^9*b^3 + C*a^10*b^2 + 2*B*a^11*b + 2*C*a^11*b))/(a^8*b + a^9 - a^6*b^3 - a^7*b^2)
- (32*b*tan(c/2 + (d*x)/2)*((a + b)^3*(a - b)^3)^(1/2)*(2*B*b^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- (b*((32*(B*a^7*b^5 - 2*B*a^6*b^6 - C*a^12 + 5*B*a^8*b^4 - 3*B*a^9*b^3 - 3*B*a^10*b^
2 + C*a^7*b^5 - 3*C*a^9*b^3 + C*a^10*b^2 + 2*B*a^11*b + 2*C*a^11*b))/(a^8*b + a^9 - a^6*b^3 - a^7*b^2) + (32*b
*tan(c/2 + (d*x)/2)*((a + b)^3*(a - b)^3)^(1/2)*(2*B*b^3 + 2*C*a^3 - 3*B*a^2*b - C*a*b^2)*(2*a^11*b - 2*a^6*b^
6 + 2*a^7*b^5 + 4*a^8*b^4 - 4*a^9*b^3 - 2*a^10*b^2))/((a^6*b + a^7 - a^4*b^3 - a^5*b^2)*(a^9 - a^3*b^6 + 3*a^5
*b^4 - 3*a^7*b^2)))*((a + b)^3*(a - b)^3)^(1/2)*(2*B*b^3 + 2*C*a^3 - 3*B*a^2*b - C*a*b^2))/(a^9 - a^3*b^6 + 3*
a^5*b^4 - 3*a^7*b^2))*(2*B*b^3 + 2*C*a^3 - 3*B*a^2*b - C*a*b^2))/(a^9 - a^3*b^6 + 3*a^5*b^4 - 3*a^7*b^2)))*((a
+ b)^3*(a - b)^3)^(1/2)*(2*B*b^3 + 2*C*a^3 - 3*B*a^2*b - C*a*b^2)*2i)/(d*(a^9 - a^3*b^6 + 3*a^5*b^4 - 3*a^7*b
^2))
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (B + C \sec {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(cos(d*x+c)**2*(B*sec(d*x+c)+C*sec(d*x+c)**2)/(a+b*sec(d*x+c))**2,x)
[Out]
Integral((B + C*sec(c + d*x))*cos(c + d*x)**2*sec(c + d*x)/(a + b*sec(c + d*x))**2, x)
________________________________________________________________________________________